package com.pubinfo.passbook.api.controller.contract;

import com.pubinfo.passbook.api.service.CompanyExcelService;
import com.pubinfo.passbook.common.model.vo.base.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@Slf4j
@RestController
@Api(tags = "拆迁赔补费权限")
@RequestMapping(value = "contractRoleController")
public class ContractRoleController {
    @Autowired
    CompanyExcelService companyExcelService;
    
    @PostMapping("importInformation")
    @ApiOperation(value = "导入权限")
    public JsonResult<Boolean> importInformation(@RequestBody MultipartFile file) throws IOException {
        return JsonResult.success(companyExcelService.importInformation(file));
    }
    
    @PostMapping("importContractPerson")
    @ApiOperation(value = "导入用户认领合同")
    public JsonResult<Boolean> importContractPerson(@RequestBody MultipartFile file) {
        return JsonResult.success(companyExcelService.importContractPerson(file));
    }
}
